package com.yimi.yinhepda.views.createPackage_module;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import butterknife.Bind;
import com.yimi.yinhepda.R;
import com.yimi.yinhepda.db.dao.BuildPckScanTableDao;
import com.yimi.yinhepda.utils.IntentUtils;
import com.yimi.yinhepda.base.BaseInitActivity;

/**
 * 建包完成的页面
 * @author 000432
 */
public class CreatePackageCompleteActivity extends BaseInitActivity {
  /** 标题栏中间 */
  @Bind(R.id.num) TextView mTvNum;
  /**包号*/
  @Bind(R.id.edit_packageno) EditText mEditPackageNo;
  /**包重量*/
  @Bind(R.id.edit_package_weight) EditText mEditPackageWeight;
  /**包体积*/
  @Bind(R.id.edit_package_volume) EditText mEditPackageVolume;
  /**总票数*/
  @Bind(R.id.edit_total_bill) EditText mEditTotalBill;
  /**目的地*/
  @Bind(R.id.edit_destion) EditText mEditDestion;
  @Bind(R.id.btn_sure) Button mBtnSure;

  @Override public String getPageName() {
    return getString(R.string.page_create_complete);
  }

  @Override public int getContentViewId() {
    return R.layout.activity_create_package_complete;
  }

  @Override public void initView(Bundle savedInstanceState) {
  }

  @Override public void initEvent() {
    mBtnSure.setOnClickListener(new View.OnClickListener() {
      @Override public void onClick(View view) {
        finish();
      }
    });
  }

  @Override public void initData() {
    //包号
    mEditPackageNo.setText(getIntent().getStringExtra(IntentUtils.PACKAGENO));
    //包重量
    mEditPackageWeight.setText(getIntent().getStringExtra(IntentUtils.PACKAGEWEIGHT));
    //包体积
    mEditPackageVolume.setText(getIntent().getStringExtra(IntentUtils.PACKAGEVOLUME));
    //总票数
    mEditTotalBill.setText(getIntent().getStringExtra(IntentUtils.TOTALPIAO));
    mEditDestion.setText(getIntent().getStringExtra(IntentUtils.BUILD_DEST));
  }

  @Override protected void onResume() {
    super.onResume();
    /** 查询未上传数据*/
    int totalNotUploadNum = new BuildPckScanTableDao().queryNotUploadDataNum();
    mTvNum.setText(totalNotUploadNum + "");
  }
}
